import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
  {
    title: '任务名称',
    align: "center",
    dataIndex: 'lsName',
    width:350
  },
  {
    title: '任务内容',
    align: "center",
    dataIndex: 'lsContent'
  },
  {
    title: '实验人员',
    align: "center",
    dataIndex: 'userName',
    width:150
  },
  {
    title: '实验项目数量',
    align: 'center',
    dataIndex: 'counting',
  },
  {
    title: '开始时间',
    align: "center",
    dataIndex: 'startDate',
    customRender:({text}) =>{
      return !text?"":(text.length>10?text.substr(0,10):text);
    },
    width:150
  },
  {
    title: '截至时间',
    align: "center",
    dataIndex: 'endDate',
    customRender:({text}) =>{
      return !text?"":(text.length>10?text.substr(0,10):text);
    },
    width:150
  },
  // {
  //   title: '备注',
  //   align: "center",
  //   dataIndex: 'remark'
  // },
];
export const columnsRecord: BasicColumn[] = [
  {
    title: '实验项目',
    align: "left",
    dataIndex: 'itemName',
    width:300
  },
  {
    title: '实验人员',
    align: "left",
    dataIndex: 'userName',
    width:200
  },
  {
    title: '项目状态',
    align: "center",
    dataIndex: 'itemStatus',
    width:120,
  },
  {
    title: '实验时间',
    align: 'center',
    dataIndex: 'itemStartTime',
    width:260,
  },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
  {
    label: "任务名称",
    field: 'lsName',
    component: 'JInput',
    colProps: {span: 6},
  },
  {
    label: "实验人员",
    field: 'userName',
    component: 'JInput',
    colProps: {span: 6},
  },
];

//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '任务名称',
    field: 'lsName',
    component: 'Input',
  },
  {
    label: '任务内容',
    field: 'lsContent',
    component: 'Input',
  },
  {
    label: '实验人员id',
    field: 'userId',
    component: 'Input',
  },
  {
    label: '实验人员',
    field: 'userName',
    component: 'Input',
  },
  {
    label: '开始时间',
    field: 'startDate',
    component: 'DatePicker',
  },
  {
    label: '截至时间',
    field: 'endDate',
    component: 'DatePicker',
  },
  {
    label: '备注',
    field: 'remark',
    component: 'Input',
  },
	// TODO 主键隐藏字段，目前写死为ID
  {
    label: '',
    field: 'id',
    component: 'Input',
    show: false,
  },
];
